//
//  UIFont+LLAdd.m
//  SLWallet
//
//  Created by admin on 2019/1/3.
//  Copyright © 2019 admin. All rights reserved.
//

#import "UIFont+LLAdd.h"
#import "LLDeviceModel.h"

@implementation UIFont (LLAdd)

+ (void)load {
    
    Method selfMethod = class_getClassMethod([self class], @selector(ll_systemFontOfSize:));
    Method systenMethod = class_getClassMethod([self class], @selector(systemFontOfSize:));
    method_exchangeImplementations(selfMethod, systenMethod);
    
    
    Method selfMethod1 = class_getClassMethod([self class], @selector(ll_boldSystemFontOfSize:));
    Method systenMethod1 = class_getClassMethod([self class], @selector(boldSystemFontOfSize:));
    method_exchangeImplementations(selfMethod1, systenMethod1);
    
    Method selfMethod2 = class_getClassMethod([self class], @selector(ll_fontWithName:size:));
    Method systenMethod2 = class_getClassMethod([self class], @selector(fontWithName:size:));
    method_exchangeImplementations(selfMethod2, systenMethod2);
}

+ (UIFont *)ll_systemFontOfSize:(CGFloat)fontSize {
    
//    CGFloat scale = [[LLDeviceModel iphoneName] containsString:@"iPad"] ? 1.3 : kScale;
    CGFloat scale = kScale > 1.3 ? 1.3 : kScale;
    return [UIFont ll_systemFontOfSize:fontSize *scale];

}

+ (UIFont *)ll_boldSystemFontOfSize:(CGFloat)fontSize {
    
//    CGFloat scale = [[LLDeviceModel iphoneName] containsString:@"iPad"] ? 1.3 : kScale;
    CGFloat scale = kScale > 1.3 ? 1.3 : kScale;
    return [UIFont ll_boldSystemFontOfSize:fontSize *scale];
    
}

+ (nullable UIFont *)ll_fontWithName:(NSString *)fontName size:(CGFloat)fontSize
{
//    CGFloat scale = [[LLDeviceModel iphoneName] containsString:@"iPad"] ? 1.3 : kScale;
    CGFloat scale = kScale > 1.3 ? 1.3 : kScale;
    return [UIFont ll_fontWithName:fontName size:fontSize *scale];
}

@end
